import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;

public class generate {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/pim","root","lcy12325")
                .globalConfig(builder -> {
                    builder.author("yb")
                            .outputDir("C:/Users/ybb/Desktop/workspace/ude-PIM-backend/src/main/java/");
                })
                .packageConfig(builder -> {
                    builder.parent("com.ude.pim");
                })
                .strategyConfig(builder -> {
                    builder.addTablePrefix("pim_")
                            .entityBuilder()
                            .enableFileOverride()
                            .enableLombok()
                            .enableRemoveIsPrefix()
                            .enableTableFieldAnnotation()
                            .naming(NamingStrategy.underline_to_camel)
                            .logicDeleteColumnName("deleted")
                            .controllerBuilder()
                            .enableRestStyle()
                            .serviceBuilder()
                            .formatServiceFileName("%sService");
                }).execute();
    }
}
